package com.ruoyi.project.system.domain.BeiDiao;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.project.system.domain.dto.QueryData;
import lombok.Data;

@Data
public class ThreeElement extends Base {

    private String attributeEn;

    private String province;

    private String city;

    private String attribute;

    private String checkResult;

    public ThreeElement() {
    }

    public ThreeElement(String orderNo, String msg) {
        this.setOrderNo(orderNo);
        this.setStatus("9");
        this.setMsg(msg);
    }

    public ThreeElement(String orderNo, QueryData result) {
        this.setOrderNo(orderNo);
        this.setStatus("1");
        this.setMsg(result.getMsg());
        JSONObject data = (JSONObject) result.getInfo();
        this.attributeEn = data.getString("attribute_en");
        this.province = data.getString("province");
        this.city = data.getString("city");
        this.attribute = data.getString("attribute");
        String cr = data.getString("checkResult");
        this.checkResult = "0".equals(cr) ? "匹配" : "1".equals(cr) ? "不匹配" : "";
    }
}
